<template>
	<view style='height:30px;clear:both'></view>
	<view class='menu-footer-container'>
		<view class='menu-footer-wrapper'>
			<view class='menu-item' @click="checkMenu" data-label='home'>
				<image src='/static/image/ico-calendar-blue.png' mode="widthFix" class='i2' v-if='current=="home"'></image>
				<image src='/static/image/ico-calendar.png' mode="widthFix" class='i2' v-if='current!="home"'></image>
				<view class='menu-txt' :class='current=="home"?"active":""'>首页</view>
			</view>
			<view class='menu-item' @click="checkMenu" data-label='ai'>
				<image src='/static/image/ico-ai-blue.png' mode="widthFix" class='i2' v-if='current=="ai"'></image>
				<image src='/static/image/ico-ai.png' mode="widthFix" class='i2' v-if='current!="ai"'></image>
				<view class='menu-txt' :class='current=="ai"?"active":""'>AI食谱</view>
			</view>
			<view class='menu-item' @click="checkMenu" data-label='bucket'>
				<image src='/static/image/ico-food-blue.png' mode="widthFix" class='i2' v-if='current=="bucket"'></image>
				<image src='/static/image/ico-food.png' mode="widthFix" class='i2' v-if='current!="bucket"'></image>
				<view class='menu-txt' :class='current=="bucket"?"active":""'>菜篮子</view>
			</view>
			<view class='menu-item' @click="checkMenu" data-label='my'>
				<image src='/static/image/ico-history-blue.png' mode="widthFix" class='i2' v-if='current=="my"'></image>
				<image src='/static/image/ico-history.png' mode="widthFix" class='i2' v-if='current!="my"'></image>
				<view class='menu-txt' :class='current=="my"?"active":""'>我的</view>
			</view>
		</view>
	</view>
</template>

<script>
	import audio from '@/lib/audio.js';
	export default {
		
		name:"menufooter", 
		props: {
			current: {
				type: String,
				default: 'home'
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			checkMenu(e){
				audio.playClick();
				this.current=e.currentTarget.dataset.label;
			}
		}
	}
</script>

<style>
	.menu-footer-container{
		display: flex;
		flex-direction: column;
		flex-wrap: wrap;
		justify-content: flex-start;
		align-items: center;
		width: 100%;
		position: fixed;
		bottom: 0px;
		left: 0px;
		background-color: #f1f1f1;
	}
	
	.menu-footer-wrapper{
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		justify-content: space-between;
		align-items: center;
		width: 100%;
		height: 65px;
		background-color: #fff;
	}
	
	.menu-item{
		width: 25%;
		display: flex;
		flex-direction: column;
		flex-wrap: wrap;
		justify-content: center;
		align-items: center;
	}
	
	.menu-txt{
		color: #ccc;
		font-size: 12px;
		padding-top: 2px;
	}
	
	.menu-txt.active{
		color: #33b4ff;
	}
</style>